import 'package:flutter/material.dart';
import 'package:mini_black_box/global/my_colors.dart';

class RecommendScreen extends StatefulWidget {
  const RecommendScreen({Key? key}) : super(key: key);

  @override
  State<RecommendScreen> createState() => _RecommendScreenState();
}

class _RecommendScreenState extends State<RecommendScreen>
    with SingleTickerProviderStateMixin {
  // tab 控制器
  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(
      length: 5,
      vsync: this,
      initialIndex: 0,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Column(
        children: [
          SizedBox(
            height: 30.0,
            child: TabBar(
              labelColor: primary,
              labelStyle: const TextStyle(
                fontSize: 14.0,
                fontWeight: FontWeight.bold,
              ),
              unselectedLabelColor: lighter,
              unselectedLabelStyle: const TextStyle(
                fontSize: 12.0,
                fontWeight: FontWeight.w200,
              ),
              controller: _tabController,
              indicatorSize: TabBarIndicatorSize.label,
              isScrollable: true,
              physics: const BouncingScrollPhysics(),
              tabs: const [
                Text('全部'),
                Text('PC游戏'),
                Text('绝地求生'),
                Text('赛博朋克2077'),
                Text('CS:GO'),
              ],
            ),
          )
        ],
      ),
    );
  }
}
